<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of membre
 *
 * @author AHAMADA
 */
class membre extends CI_Controller {
     
     function __construct()
     {
        parent::__construct();
        $this->load->database();
        $this->load->library(array('ion_auth','form_validation'));
        $this->load->helper(array('form', 'url','html'));
        $this->data = $this->ion_auth->user()->row();
        
		 
     }   
     
     public function home()
     {
        $page = 'home';
        if ( ! file_exists('application/frontend/views/membre/'.$page.'.php'))
        {
                // Whoops, we don't have a page for that!
                show_404();
        }
        $data['title'] = ucfirst($page); // Capitalize the first letter

     
        
        if (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())
        {
                redirect('/', 'refresh');
        }
        else
        {
            $this->load->view('templates/header', $this->data);
            $this->load->view('membre/'.$page, $this->data);
            $this->load->view('templates/footer', $this->data);
        }
        
     }   
}

?>
